package top.tangyh.lamp.care.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.tangyh.basic.base.R;
import top.tangyh.basic.interfaces.echo.EchoService;
import top.tangyh.basic.base.controller.SuperController;
import top.tangyh.lamp.care.service.BTimePlanService;
import top.tangyh.lamp.care.entity.BTimePlan;
import top.tangyh.lamp.care.vo.save.BTimePlanSaveVO;
import top.tangyh.lamp.care.vo.save.TimePlanInVO;
import top.tangyh.lamp.care.vo.update.BTimePlanUpdateVO;
import top.tangyh.lamp.care.vo.result.BTimePlanResultVO;
import top.tangyh.lamp.care.vo.query.BTimePlanPageQuery;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * 病人时间计划表
 * </p>
 *
 * @author zqb
 * @date 2024-07-18 15:15:54
 * @create [2024-07-18 15:15:54] [zqb] [代码生成器生成]
 */
@Slf4j
@RequiredArgsConstructor
@Validated
@RestController
@RequestMapping("/time_plan")
@Tag(name = "病人时间计划")
public class BTimePlanController {

//    extends SuperController<BTimePlanService, Long, BTimePlan
//            , BTimePlanSaveVO, BTimePlanUpdateVO, BTimePlanPageQuery, BTimePlanResultVO>
//    private final EchoService echoService;
//    @Override
//    public EchoService getEchoService() {
//        return echoService;
//    }

    private final BTimePlanService bTimePlanService;

    @Operation(summary = "添加时间计划")
    @PostMapping("/add")
    public R<List<Long>> add(@RequestBody TimePlanInVO inVO) {
        List<Long> timeList = bTimePlanService.add(inVO);
        return R.success(timeList);
    }

    @Operation(summary = "删除时间计划")
    @DeleteMapping("/delete")
    public R delete(Long id) {
        return R.success(bTimePlanService.deleteTimePlan(id));
    }
}


